<template>
    <div>
        <h1 ref="title">Vite create Vue2</h1>
        <button ref="btn" @click="showDOM">获取DOM</button>
        <Student ref="sch" name="李四" :age="20"></Student>
        <!-- <School></School> -->
    </div>
</template>

<script>
// 引入组件
import Student from './components/Student.vue'
import School from './components/School.vue'
export default {
    name:'App',
    components:{
        Student,
        School
    },
    methods:{
        showDOM(){
            console.log(this.$refs.title);//真实DOM
            console.log(this.$refs.sch);//School组件的实例对象（vc）

        }
    }
}
</script>